package types

const (
	Fail    = -1
	Success = 0
	// ParamsError 参数错误.
	ParamsError = 1000
	// ExceptionError .
	ExceptionError = 1001
	// TokenNotAuth 请求未携带token，无权限访问.
	TokenNotAuth = 1002
	// TokenIsExpire 授权已过期.
	TokenIsExpire   = 1003
	NotAuth         = 1004
	UploadError     = 1005
	UserOrPwdERR    = 1006
	SetProfileErr   = 1007
	DelRelationUser = 1008
	SubscribeErr    = 1009
	ActionNotFound  = 1010
	SignatureError  = 1011
	// CalibratorStatusError 状态错误.
	CalibratorStatusError = 1012
	// CalibratorStatusBootUp 设备处于开机状态.
	CalibratorStatusBootUp     = 1013
	CalibratorSendCommandErr   = 1014
	InstrumentSendCommandError = 1015

	//  通讯失败.

	CalibratorNewsletterErr = 1016
	InstrumentNewsletterErr = 1017
	// DeviceStatusIsAbnormal 设备状态异常.
	DeviceStatusIsAbnormal = 1018
	// NetworkAnomaly 网络异常.
	NetworkAnomaly = 1019
	GetValueError  = 1020
	//RedisError redis错误
	RedisError = -330000
	//DBError 数据库错误
	DBError = -330001
	//ParamMissed 参数丢失
	ParamMissed = -330002
	//ProxyError 代理服务错误
	ProxyError = -330003
)

var Msg = map[int]string{
	Fail:                       "失败.",
	Success:                    "成功.",
	ParamsError:                "参数错误.",
	ExceptionError:             "异常错误.",
	RedisError:                 "redis错误.",
	DBError:                    "数据库错误.",
	ParamMissed:                "参数丢失.",
	ProxyError:                 "代理服务错误.",
	TokenNotAuth:               "请求未携带token，无权限访问.",
	NotAuth:                    "无权限访问.",
	UploadError:                "上传失败.",
	UserOrPwdERR:               "用户名称或者密码错误.",
	SetProfileErr:              "更新失败,部分参数超出设备支持范围.",
	DelRelationUser:            "请先删除关联用户.",
	SubscribeErr:               "订阅失败.",
	ActionNotFound:             "action not found.",
	SignatureError:             "签名错误.",
	CalibratorStatusError:      "当前设备正在校准中.",
	CalibratorStatusBootUp:     "设置处于开机状态.",
	CalibratorSendCommandErr:   "校准仪发送命令失败.",
	InstrumentSendCommandError: "仪器发送命令失败.",
	CalibratorNewsletterErr:    "校准仪仪器通讯错误",
	InstrumentNewsletterErr:    "仪器通讯错误",
	DeviceStatusIsAbnormal:     "设备状态异常.",
	NetworkAnomaly:             "网络异常,请稍后重试.",
	GetValueError:              "获取value失败.",
}
